//
//  App_AlertHandler.swift
//  mall-ios
//
//  Created by Meak Tsui on 2019/1/7.
//  Copyright © 2019 Meak Tsui. All rights reserved.
//

import Foundation
import MTHybrid

extension Api {
    static let Alert = Api("alert")
}

class App_AlertHandler: MTEventHandler {
    var ns: Ns {
        return .App
    }
    
    var action: Api {
        return .Alert
    }
    
    func handler(_ msg: MTHybridMsg) {
        let title = msg.params["title"] as? String
        let message = msg.params["msg"] as? String
        
        msg.vc.alert(title: title, message: message) {
            msg.callbackClosure?(true)
        }
    }
    
    
}
